<?php

namespace App\Http\Resources\Admin;

use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;

class RoleResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @return array<string, mixed>
     */
    public function toArray(Request $request): array
    {
        $data = [
            'code' => $this->code,
            'createTime' => $this->created_at,
            'id' => $this->id,
            'name' => $this->name,
            'dataScope' => $this->data_scope,
            'sort' => $this->sort,
            'status' => $this->status,
            'updateTime' => $this->updated_at,
        ];
        return $data;
    }
}
